<div class="modal-dialog">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h4 class="modal-title" id="myModalLabel">选择员工</h4>
		</div>
		<div class="modal-body form-horizontal">
			<table class="table" style="margin-bottom:0px;">
				<tbody>
					<tr>
						<th><input type="checkbox" id="checkall"></th>
						<th>用户名</th>
						<th>性别</th>
						<th>部门 - 岗位</th>
						<th>手机</th>
						<th>Email</th>
					</tr>
					<volist name="userlist" id="vo">
					<tr>
						<td><input type="checkbox" name="to_user_id[]" value="{$vo.user_id}"></td>
						<td>{$vo.name}</td>
						<td><if condition="$vo['sex'] == 1">男<elseif condition="$vo['sex'] == 2" />女<else />未知</if></td>
						<td>{$vo.department_name} - {$vo.position_name}</td>
						<td>{$vo.telephone}</td>
						<td>{$vo.email}</td>
					<tr>
					</volist>
				</tbody>
			</table>
		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			<input type="button" class="btn btn-primary" id="check_ed" value="确定" />
		</div>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$('#check_ed').click(function(){
			str = '';
			name = '';
			$("input[name='to_user_id[]']:checked").each(function(){
				str+=$(this).val()+",";
				name+=$(this).parent().next().html()+",";
            })
			$('#str_user_name').val(name);
			$('#str_user_id').val(str);
			$('#alert').modal('hide');
		});
		$("#checkall").click(function(){
			$("input[name='to_user_id[]']").prop('checked', $(this).prop("checked"));
		});
	});
</script>